diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-11-20 18:38:15 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-11-20 18:38:15 +0100 |
commit | 1c1dfcb66b25c5dd387dfc7ff83e7b43146ae481 (patch) | |
tree | f92ad4c4c060c96e257b852d0d534b43cc4d80d4 | |
parent | 60f09e834029a8b8d8afea5f308c9027e876cbec (diff) | |
download | Chimère - projet Saclay-1c1dfcb66b25c5dd387dfc7ff83e7b43146ae481.tar.bz2 Chimère - projet Saclay-1c1dfcb66b25c5dd387dfc7ff83e7b43146ae481.zip |
Improve share links
-rw-r--r-- | templates/chimere/blocks/share_bar.html | 17 | ||||
-rw-r--r-- | templates/chimere/detail.html | 4 |
2 files changed, 17 insertions, 4 deletions
diff --git a/templates/chimere/blocks/share_bar.html b/templates/chimere/blocks/share_bar.html index b5a24e8..39caf59 100644 --- a/templates/chimere/blocks/share_bar.html +++ b/templates/chimere/blocks/share_bar.html @@ -5,15 +5,28 @@ {% endfor %}{%else%} <ul class='share'> <li class='share-send'><a class='share_link share_id_{{share_networks.0.0}}{% if email_only %}_single{%endif%}' href='{{share_networks.0.1}}'><img src="{{share_network.0.2}}" alt="{{share_network.0.0}}"/></a></li> - {% if not email_only %}<li class='share-icon'><a href="#">{% trans "Share" %}</a></li>{% for share_network in share_networks %} + {% if not email_only %} + <li class="share-link-main"> + <a href="#">{% trans "Share" %}</a></li> + {% for share_network in share_networks %} <li class='shared'><a class='share_link share_id_{{share_network.0}}' href='{{share_network.1}}'><img src="{{share_network.2}}" alt="{{share_network.0}}"/></a></li> {% endfor %} - <li class='shared'><a href='{% url 'chimere:feeds-global' %}'><img src='{{STATIC_URL}}chimere/img/feed.png' alt='Feeds'/></a></li>{%endif%} + {% if rss %}<li class='shared'><a href='{% url "chimere:feeds-global" %}'> + <img src='{{STATIC_URL}}chimere/img/feed.png' alt='Feeds'/></a></li>{% endif %}{%endif%} </ul>{% endif %} <script type='text/javascript'> <!-- $(function(){ share_link_update(); + $('.share-link-main').click(function(){ + update_permalink(); + var params = $('#permalink').attr('href').split('#')[1]; + var current_url = String(window.location.href).split('#')[0] + + "#" + params; + var message = "{% trans 'Copy and paste this address to share this item: \n' %}"; + message += current_url; + alert(message); + }); }); // --> </script> diff --git a/templates/chimere/detail.html b/templates/chimere/detail.html index e9105f5..fccbc05 100644 --- a/templates/chimere/detail.html +++ b/templates/chimere/detail.html @@ -39,9 +39,9 @@ <li><a href="{{modif_by_email}}">{% trans "Propose a modification" %}</a></li> <li class='sep'>–</li> </ul> - {% share_bar marker.name %} + {% share_bar marker.name '' '' %} {% comment %} - <a href='{% if marker.route %}{% url 'chimere:editroute-item' area_name_slash|default_if_none:"" marker.route.pk "" %}{%else%}{% url 'chimere:edit-item' area_name_slash|default_if_none:"" marker.pk "" %}{%endif%}'> + <a href='{% if marker.route %}{% url "chimere:editroute-item" area_name_slash|default_if_none:"" marker.route.pk "" %}{%else%}{% url 'chimere:edit-item' area_name_slash|default_if_none:"" marker.pk "" %}{%endif%}'> {% trans "Submit a modification" %} </a> {% endcomment %} |